import requests
import json
import configparser
import logging

#读取config/cfg.ini文件
cfg_ini_path = 'config/cfg.ini'
config = configparser.ConfigParser()
config.read(cfg_ini_path)

debug = config.getboolean(section='DEFAULT', option='debug')
if debug:
    log_level = config.get(section='DEFAULT', option='log_level').upper()
    logging.basicConfig(
        level=log_level,
        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
    )
